package com.qc31.comlib.adapter

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.qc31.comlib.R
import com.qc31.comlib.entity.KeyValue

/** @Author Jasper @Time 2020/9/28 @Desc todo */
class KeyValueAdapter : BaseQuickAdapter<KeyValue, BaseViewHolder>(R.layout.item_key_value) {
    var index = -1
    override fun convert(holder: BaseViewHolder, item: KeyValue) {
        item.run {
            holder.getView<ImageView>(R.id.ivChooseStart).isSelected =
                holder.layoutPosition == index
            holder.setText(R.id.tvChooseTitle, value)
        }
    }
}